﻿using System.Text;
using System.Xml.Linq;

namespace SPQueryToSql.ApplicationObjects.CAML
{
    internal class RowLimit
    {
        public string Value;

        public RowLimit(XElement element)
        {
            Value = element.Value;
        }

        public override string ToString()
        {
            return ToString(0);
        }

        public string ToString(int tabQnt)
        {
            var sb = new StringBuilder();
            const string tab = @"    ";
            for (var i = 0; i < tabQnt; i++) sb.Append(tab);
            sb.AppendFormat("<RowLimit>{0}</RowLimit>", Value);
            return sb.ToString();
        }
    }
}
